package edu.hawaii.ics414.blackjack.card;

/**
 * The rank of this card.
 * 
 * @author Branden Ogata
 *
 */

public enum Rank
{
  ACE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING;
  
  /**
   * Returns a String representation of this Rank.
   * 
   * @return Returns "A" for an Ace,
   *                 the numeric representation for TWO, ... , TEN,
   *                 "J" for a Jack,
   *                 "Q" for a Queen, and
   *                 "K" for a King.
   *                 
   */
  
  @Override
  public String toString()
  {
    switch (this)
    {
      case ACE:
        return "A";
      // Now that I have written this, there is probably a method that converts 
      // a word representation of a number to a numeric value
      case TWO:
        return "2";
      case THREE:
        return "3";
      case FOUR:
        return "4";
      case FIVE:
        return "5";
      case SIX:
        return "6";
      case SEVEN:
        return "7";
      case EIGHT:
        return "8";
      case NINE:
        return "9";
      case TEN:
        return "10";
      case JACK:
        return "J";
      case QUEEN:
        return "Q";
      case KING:
        return "K";
      default:
        throw new IllegalStateException("Invalid rank");
    }
  }
}
